<?php
/*
 * function polling script\
 */

function script_add_log_into_table($interface_id,$status,$sms){
		$group = db_fetch_cell('Select interface_group_id From plugin_nms_interfacegroup Where interface_id = '.$interface_id.'');
		db_execute('Insert into plugin_nms_log (interface_id, nms_status, nms_time,interface_group_id,send_sms)
							values ("'.$interface_id.'","'.$status.'",now(),'.$group.',"'.$sms.'")');
}
function script_update_status_interface($interface_id,$status){
		db_execute('Update plugin_nms_interface
							Set nms_status = "'.$status.'",
									issound = 1
							Where interface_id = '.$interface_id.'');
}
function script_update_resume_interface($interface_id){
	db_execute('Update plugin_nms_interface
							Set nms_pause = 1
							Where interface_id = '.$interface_id.'');
} 

/*
 * function autoupdate script
 */
function script_update_pause_interface($interface_id){
	db_execute('Update plugin_nms_interface
				Set nms_pause =0
				Where interface_id = '.$interface_id.'');
}
function script_update_resume_all(){
	db_execute('Update plugin_nms_interface
							Set nms_pause = 1
							Where nms_status = "Up"');
}
?>